<?php
namespace BP\DA;
require_once("java/util/LinkedHashMap.php");
require_once("BP/Tools/StringUtils.php");
class DataRow 
// extends LinkedHashMap 
{
	protected static $serialVersionUID;	// long
	public $table;	// DataTable
	public $columns;	// DataColumnCollection
	public $ItemArray;	// Object
	public static function __staticinit() { // static class members
		self::$serialVersionUID = 1;
	}
	public function getItemArray () 
	{
		return $this->ItemArray;
	}
	public function setItemArray ($itemArray) // [Object itemArray]
	{
		$this->ItemArray = $itemArray;
	}
	public static function constructor__DataTable ($table) // [DataTable table]
	{
		$me = new self();
		$me->table = $table;
		$me->columns = $table->Columns;
		return $me;
	}
	public function getTable () 
	{
		return $this->table;
	}
	public function setValue_I_Object ($columnIndex, $value) // [int columnIndex, Object value]
	{
		$this->setValue_String_Object($this->columns->get($columnIndex), $value);
	}
	public function setDataType ($columnIndex, $dataType) // [int columnIndex, Object dataType]
	{
		$this->columns->get($columnIndex)->setDataType($dataType);
	}
	public function setValue_String_Object ($columnName, $value) // [String columnName, Object value]
	{
		$this->put($columnName, $value);
	}
	public function setValue_String_Boolean ($columnName, $value) // [String columnName, Boolean value]
	{
		if (($value ==  TRUE ))
			$this->put($columnName, 1);
		else
			$this->put($columnName, 0);
	}
	public function setValueStr ($columnName, $value) // [String columnName, String value]
	{
		$this->put($columnName, (("\"" . $value) . "\""));
	}
	public function setValue2017 ($columnName, $value) // [String columnName, Object value]
	{
		$this->put($columnName, $value);
	}
	public function setValue_DataColumn_Object ($column, $value) // [DataColumn column, Object value]
	{
		if (($column != NULL))
		{
			$lowerColumnName = $column->ColumnName;
			if ($this->containsKey($lowerColumnName))
				$this->remove($lowerColumnName);
			$this->put($lowerColumnName, $value);
		}
	}
	public function setValue_UL ($column, $value) // [DataColumn column, Object value]
	{
		if (($column != NULL))
		{
			$lowerColumnName = $column->ColumnName;
			if ($this->containsKey($lowerColumnName))
				$this->remove($lowerColumnName);
			$this->put($lowerColumnName, $value);
		}
	}
	public function getValue_I ($columnIndex) // [int columnIndex]
	{
		$obj = $this->get($this->columns->get($columnIndex)->ColumnName);
		if (($obj == NULL))
		{
			$obj = "";
		}
		return $obj;
	}
	public function getValue_String ($columnName) // [String columnName]
	{
		$obj = $this->get($columnName);
		if (($obj == NULL))
		{
			if (!is_null($this->get($columnName->toLowerCase())))
			{
				$obj = $this->get($columnName->toLowerCase());
			}
			if (!is_null($this->get($columnName->toUpperCase())))
			{
				$obj = $this->get($columnName->toUpperCase());
			}
			else
			{
				$obj = "";
			}
		}
		return $obj;
	}
	public function getValue_DataColumn ($column) // [DataColumn column]
	{
		$obj = $this->get($column->ColumnName);
		if (($obj == NULL))
		{
			$obj = "";
		}
		return $obj;
	}
	public function set ($string, $object) // [String string, Object object]
	{
		if (($object == NULL))
			$object = "";
		$this->set($string, $object);
	}
}
DataRow::__staticinit(); // initialize static vars for this class on load
?>
